package booking;

import java.util.HashMap;
import java.util.Map;

/**
 * Created by James.Owen on 16/02/14.
 */
public class EmailResponseObject {

    public Map<String, Object> getEmailTemplateMap(Map<String, Object> requestParameters, CostCalculator costCalculator) {
        BookingViewAdapter bookingViewAdapter = new BookingViewAdapter();
        String numberOfChildrenText = bookingViewAdapter.getNumberOfChildrenText(costCalculator.getNumberOfChildren());
        String costOfChildrenText = bookingViewAdapter.getCostOfChildrenText(costCalculator.getCostOfChildren());
        String totalCostText = bookingViewAdapter.getTotalCostText(costCalculator.getTotalCost());


        Map<String, Object> map = new HashMap<String, Object>();
        map.put("adultName", requestParameters.get("adultname"));
        map.put("address", requestParameters.get("address"));
        map.put("postcode", requestParameters.get("postcode"));
        map.put("telephoneNumber", requestParameters.get("telephoneNumber"));
        map.put("mobileNumber", requestParameters.get("mobileNumber"));
        map.put("childName", requestParameters.get("childname"));
        map.put("childAge", requestParameters.get("childAge"));
        map.put("dateOfParty", requestParameters.get("datepicker"));
        map.put("timeOfParty", requestParameters.get("timeOfParty"));
        map.put("numberOfChildren", numberOfChildrenText);
        map.put("costOfChildren", costOfChildrenText);
        map.put("totalCostOfParty", totalCostText);
        map.put("numberOfSandwichPlatters", costCalculator.getSandwichPlatters());
        map.put("costOfSandwichPlatters", costCalculator.getSandwichPlatters() * 5);
        map.put("costOfDipsPlatters", costCalculator.getDipPlatters() * 5);
        map.put("numberOfDipsPlatters", costCalculator.getDipPlatters() * 5);
        map.put("partyBagsSelected", costCalculator.getPartyBags());
        map.put("jazzySelected", costCalculator.getJazzyRequired());
        map.put("costOfPartyBags", costCalculator.getNumberOfChildren() * 1.50);
        map.put("additionalComments", requestParameters.get("additionalComments"));

        return map;
    }
}
